Voltage to duty cycle converter

ABSTRACT

An analog voltage to duty cycle converter is provided using a series connected resistor and capacitor. The capacitor is charged in one direction through the resistor from the difference between the analog voltage and a reference voltage maintained across a zener diode by one polarity of output from a differential amplifier responding to the charge across the capacitor. When the charge across the capacitor reaches the difference necessary to cause the differential amplifier to change the polarity of its output, a positive feedback firmly toggles the output to the other polarity and the capacitor is allowed to charge in the opposite direction due to cut-off of the zener current by a diode in the amplifier output circuit. The capacitor then charges in an opposite direction due to the analog voltage alone and the reference voltage again switches &#34;on&#34; when the amplifier output goes positive. The duty cycle is then proportional to the analog voltage.

BACKGROUND OF THE INVENTION

Analog to digital converters usually require precision resistors orcapacitors and switches. Such elements tend to unduly increase the costof those converters as does the need for large power supplies. Inapplications using microprocessors the possibility of using themicroprocessor for counting time presents itself. It is therefore anobject of this invention to provide apparatus for producing in a simple,accurate and economical way a digital representation of an analogvoltage when a microprocessor is available to provide the countingfunction.

SUMMARY OF THE INVENTION

A voltage to duty cycle converter is provided for producing a digitalrepresentation of an analog voltage. The circuit includes a seriesconnected capacitor and resistor charged over a voltage range from areference voltage source which can be disconnected or shorted fordischarge of the capacitor over that range. The duty cycle of thisswitching is proportional to the analog voltage. The charging period isterminated when the capacitor takes a charge which exceeds the analogvoltage by a small amount. At that time a detector responds to thatdifference by switching the reference voltage source off or by shortingit so that the capacitor discharges to decrease the charge by the samesmall amount below the analog voltage at which time the referencevoltage source is switched back on or reconnected and another cyclebegins.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a circuit diagram of one form of the invention.

FIG. 2 is a circuit diagram of another form of the invention.

DESCRIPTION OF THE PREFERRED EMBODIMENT

The conversion of an analog voltage to a digital representation, such asthe duty cycle of a waveform, is a function which has many uses. Amongthem is its use to convert an analog position; for example, a slidewirecontact position on an analog recording instrument. It is desirable insome instances to make this conversion for the purpose of furtherprocessing of the resulting digital representation as in amicroprocessor. For example, when the slidewire contact is in arebalanceable recorder used for measuring industrial process variables,the microprocessor may be programmed to provide alarm functions.

In FIG. 1 the slidewire S1 may be a slidewire whose contact ispositioned in accordance with a process measurement. The slidewire issupplied from a power supply at a voltage +V so that the input to thenon-inverting input 10 of a buffer amplifier U2 is a varying analogvoltage which must be converted to digital form for processing.

The amplifier U2 is supplied by power supplies +V and -V and has itsoutput connected to its inverting input so that the output voltageclosely follows the input voltage.

The potentiometer R8 and resistor R9 provide a span adjustment whenconnected as shown in FIG. 1 so that only a portion of the bufferamplifier output is used. By the span adjustment, the range of voltagesover which the variable input will change during full travel of thepotentiometer contact 11 is determined.

The tap 12 of the potentiometer R8 is fed through an input resistor R1to the non-inverting input of a differential amplifier U1. A positivevoltage on this input causes the output line 14 to be positive if weassume that any signal to the inverting input is less than the inputprovided from contact 12. The diode CR1 is conductive for positiveamplifier outputs on line 14 so that a current flows in the outputcircuit for amplifier U1 under these conditions.

The output circuit includes an optical isolator AR1 connected in serieswith a resistor R5 and a zener diode VR1 so that a reference voltage ofconstant value is produced across VR1 with any variations in the outputof U1 appearing across resistor R5. The current in the optical isolatorAR1 then provides an output on output line 16 which is an inverted formof the output on line 14. The output on line 16 is thus zero when 14 ispositive.

The difference between the analog voltage and the oppositely poledpotential across VR1 of greater magnitude causes a charging in onedirection of capacitor C1 by virtue of the resulting current flowthrough the series circuit including resistor R3 and capacitor C1 andthe analog voltage input across R9 and the lower part of R8. Thecapacitor C1 is connected to the inverting input of amplifier U1 so thatwhen capacitor C1 charges to a value which places the inverting input ofU1 at a small voltage above that at the non-inverting input, the outputon line 14 will go negative. The small voltage is that magnitude ofunbalance required at the inputs to reach one limit of the dead band ofU1 so as to reverse the polarity of the output of U1. CR1 will then beback-biased, output current flow from U1 will cease and the voltageacross VR1 will go to zero. When this occurs the positive feedbackprovided by the series circuit including capacitor C2 and resistor R2connected to line 14 through resistor R6 causes the potential at thenon-inverting input of U1 to decrease. The result will be a firm toggleaction for U1 as its output goes negative with a resulting cleanwaveform.

Since a negative output from U1 cuts off current flow through AR1, theouput on line 16 will go from zero to +V. This positive going edge willoccur at a time period T1 after the previous negative going edge, whichperiod is a function of the magnitude of the input voltage since C1 willhave been charged over a portion of its charging curve which isdetermined by the magnitude of the input voltage.

Also, with a negative output from U1 the capacitor C1 will charge in theother direction (also referred to as a discharge) through resistor R3and resistor R4 which shunts VR1, all due to the analog voltage atcontact 12. R4 is preferably as small as practicable so that theresistance of the discharge path substantially equals the resistance ofthe charging path. The potential at the inverting input of U1 will thenfall until it reaches a potential which is a small voltage below thepotential of the input to the non-inverting input of U1 thus reachingthe other limit of the dead band. At that time, which is after a periodT2 from the start of the cycle, the output of amplifier U1 will again gopositive and current will again flow through optical isolator AR1 toproduce a negative going edge to the waveform of the signal on line 16at the isolator output thus starting another cycle in the continuingoscillation of U1.

As seen in FIG. 1, the inverting input to amplifier U1 is connectedthrough resistor R11 to a contact 20 on potentiometer R10 which has oneside supplied from a potential source -V and the other side tied to acircuit common. This arrangement provides a means for adjusting the zerofor the range of variations spanned by the input from contact 12.

The circuit of FIG. 1 serves to provide a high degree of noise immunityfrom the input signal. A proportion of the noise at the input asdetermined by the voltage divider action of R1, R2, C2, and R7 isapplied to the non-inverting input of U1. The same proportion of inputnoise, determined by the voltage divider action of C1, R3, and R4 isapplied to the inverting input of U1. Since the two noises are equal,they cancel at power line frequency.

As the voltage at tap 12 increases the difference between it and thevoltage across VR1 gets smaller so that more time is needed for the partof the cycle when line 14 is positive and AR1 is "on."

AR1 optically couples the output of U1 to the microprocessor 20. Thewaveform of the output of U1 is thus repeated in inverted form on line16 since the transistor of AR1 is conductive during the positiveportions of the cycle on the output line 14. The transistor of AR1 isconnected to the +V supply by way of R12 with the emitter connected toearth ground and the base connected to the emitter by way of the basebias resistor R13. AR1 may be replaced by optical isolators configuredas a Darlington pair if increased output is desired.

The waveform of the voltage on line 16 is shown beside that line inFIG. 1. In that waveform the negative going edge of the cycle is thestart of the time periods which are measured. The time to the positivegoing edge is T1 and the time to the next negative going edge is T2. Themicroprocessor is programmed to read the count at those points and tocalculate from those readings the ratio T1/T2 which is the duty cycle ofthe waveform on line 16. The value of the duty cycle is proportional tothe analog voltage at tap S1 and hence is an indication of that value.The duty cycle value may be used in a program in the microprocessor asmay be desired for alarming functions, for example. Alternatively, ofcourse, the value may be displayed in digital display 24.

A variation of the circuit of the FIG. 1 is shown in FIG. 2. In FIG. 2the isolator AR1 has been omitted indicating that electrical isolationis not required. Thus, the line 16 is directly connected to junction 15when AR1 is omitted.

In FIG. 2 the resistor R4 of FIG. 1 is replaced by a transistor TR1which serves to provide a conducting path for the charging of capacitorC1 by the analog voltage when the negative output from U2 on line 14causes TR1 to be biased "on" by virtue of the resistor R14 connectingthe base of TR1 to the output line 14.

With the arrangement of FIG. 2 the positive feedback network includingR2 and C2 does not include R6 and R7 as shown in FIG. 1.

The differential amplifier U1 in both FIG. 1 and FIG. 2 is a detectingmeans for detecting the relationship between the input voltage to beconverted and the sum of that voltage plus the negative feedbacksupplied by the voltage across C1 so that the switching means CR1 and R5in FIG. 1 serves to switch the voltage source VR1 into and out of thecircuit. Also, it will be evident that R5 and VR1 will be a switch meansfor turning the voltage source VR1 "on" in FIG. 2 while transistor TR1in FIG. 2 will be the switch means for turning the voltage source VR1"off."

Other than the changes just mentioned, the circuit of FIG. 2 operatessubstantially as set forth for FIG. 1.

It will be evident that other variations in the circuit of FIG. 1 may bemade. For example, the capacitor C1 may have its one terminal connectedto circuit common instead of to contact 12 as shown in FIG. 1. With sucha change, the capacitor will discharge without the benefit of currentflow due to the analog voltage. However, the capacitor itself will havea greater voltage difference in that the difference will include notonly the small voltage required to switch but also the analog voltagemagnitude. Still other changes will be evident to those skilled in theart including, for example, changes in the polarities.

In carrying out this invention, the parameters of the circuits of FIGS.1 and 2 may be as set forth below:

                  FIG. 1                                                          ______________________________________                                        Component       Value       Type                                              ______________________________________                                        R1              33K                                                           R2              3.3M                                                          R3              1M                                                            R4              4.7K                                                          R5              470Ω                                                    R6              39K                                                           R7              10K                                                           R8              10K                                                           R9              22K                                                           R10             10K                                                           R11             10M                                                           R12             10K                                                           R13             330K                                                          U1                          308A                                              U2                          741                                               AR1                         4N26                                              VR1                         1N825A                                            CR1                         1N914                                             C1              .22 μf                                                     C2              .05 μf                                                     ______________________________________                                    

                  FIG. 2                                                          ______________________________________                                        Component        Value       Type                                             ______________________________________                                        R1               .33K                                                         R2               3.3M                                                         R3               1M                                                           R5               470Ω                                                   R14              10K                                                          U1                           308                                              CR1                          1N446                                            TR1                          2N3638                                           AR1                          4N26                                             C1               .22 μf                                                    C2               100 ρf.                                                  ______________________________________                                    

What is claimed is:
 1. A converter for converting an analog voltage to aduty cycle comprising:a capacitor a resistor connected at one terminalto said capacitor to form a series circuit; a differential amplifier; areference voltage source provided by a zener diode supplied by currentfrom the output of said differential amplifier; switching meansincluding a series connected diode and resistor in circuit connectingsaid zener diode to the output of said differential amplifier so thatoutputs of one polarity cause a fixed voltage to be maintained acrosssaid zener diode with outputs of opposite polarity being disconnectedfrom said zener diode by said diode, said switching means beingoperative to selectively pass charging current through said seriescircuit from said reference voltage source in one state and fordisconnecting said source to discharge said capacitor through saidresistor in another state; and detecting means including saiddifferential amplifier whose inverting input is connected to saidterminal and whose non-inverting input is connected to receive both saidanalog voltage through an input resistor and a positive feedback signalfrom the output of said amplifier by way of a seriesresistance-capacitance network connecting said output to saidnon-inverting input, said detecting means being responsive solely to thedifference between said analog voltage and the voltage at said terminalfor causing said switching means to go from said one state to said otherwhen said difference reaches a certain magnitude of one polarity and toreverse states when said difference reaches said magnitude in anopposite polarity, whereby the duty cycle of the resulting oscillationsis proportional to the value of said analog voltage.
 2. A converter forconverting an analog voltage to a duty cycle comprising:a capacitor; aresistor connected at one terminal to said capacitor to form a seriescircuit; a differential amplifier; a reference voltage source providedby a zener diode supplied by current from the output of saiddifferential amplifier; switching means including a series connecteddiode and resistor in circuit connecting said zener diode to the outputof said differential amplifier so that outputs of one polarity cause afixed voltage to be maintained across said zener diode with outputs ofopposite polarity being disconnected from said zener diode by said diodeand a transistor for providing a conductive path to discharge saidcapacitor through said resistor when said transistor is biased to theconductive state in response to said opposite polarity outputs, saidswitching means being operative to selectively pass charging currentthrough said series circuit from said reference voltage source in onestate and for disconnecting said source to discharge said capacitorthrough said resistor in another state; and detecting means includingsaid differential amplifier whose inverting input is connected to saidterminal and whose non-inverting input is connected to receive both saidanalog voltage through an input resistor and a positive feedback signalfrom the output of said amplifier by way of a seriesresistance-capacitance network connecting said output to saidnon-inverting input, said detecting means being responsive solely to thedifference between said analog voltage and the voltage at said terminalfor causing said switching means to go from said one state to said otherwhen said difference reaches a certain magnitude of one polarity and toreverse states when said difference reaches said magnitude in anopposite polarity, whereby the duty cycle of the resulting oscillationsis proportional to the value of said analog voltage.
 3. A converter forconverting an analog voltage to a duty cycle comprising:a capacitor; aresistor connected at one terminal to said capacitor to form a seriescircuit; a differential amplifier; a reference voltage source providedby a zener diode supplied by current from the output of saiddifferential amplifier; switching means including a series connecteddiode and resistor in circuit connecting said zener diode to the outputof said differential amplifier so that the output current of saidamplifier is conducted through the diode portion of an optical isolatorto produce conduction of the transistor portion for producing an outputwaveform therefrom and so that outputs of one polarity cause a fixedvoltage to be maintained across said zener diode with outputs ofopposite polarity being disconnected from said zener diode by saiddiode, said switching means being operative to selectively pass chargingcurrent through said series circuit from said reference voltage sourcein one state and for disconnecting said source to discharge saidcapacitor through said resistor in another state; and detecting meansincluding said differential amplifier whose inverting input is connectedto said terminal and whose non-inverting input is connected to receiveboth said analog voltage through an input resistor and a positivefeedback signal from the output of said amplifier by way of a seriesresistance-capacitance network connecting said output to saidnon-inverting input, said detecting means being responsive solely to thedifference between said analog voltage and the voltage at said terminalfor causing said switching means to go from said one state to said otherwhen said difference reaches a certain magnitude of one polarity and toreverse states when said difference reaches said magnitude in anopposite polarity, whereby the duty cycle of the resulting oscillationsis proportional to the value of said analog voltage.
 4. A converter forconverting an analog voltage to a duty cycle comprising:a capacitor; aresistor connected at one terminal to said capacitor to form a seriescircuit; a differential amplifier; a reference voltage source providedby a zener diode supplied by current from the output of saiddifferential amplifier; switching means including a series connecteddiode and resistor in circuit connecting said zener diode to the outputof said differential amplifier so that outputs of one polarity cause afixed voltage to be maintained across said zener diode with outputs ofopposite polarity being disconnected from said zener diode by saiddiode; a transistor for providing a conductive path to discharge saidcapacitor through said resistor when said transistor is biased to theconductive state, said switching means being operative to selectivelypass charging current through said series circuit from said referencevoltage source in one state and for disconnecting said source todischarge said capacitor through said resistor in another state; anddetecting means including said differential amplifier whose outputcurrent is conducted through the diode portion of an optical isolator soas to produce conduction of the transistor portion for producing anoutput waveform therefrom, and whose inverting input is connected tosaid terminal with the non-inverting input connected to receive bothsaid analog voltage through an input resistor and a positive feedbacksignal from the output of said amplifier by way of a seriesresistance-capacitance network connecting said output to saidnon-inverting input, said detecting means being responsive solely to thedifference between said analog voltage and the voltage at said terminalfor causing said switching means to go from said one state to said otherwhen said difference reaches a certain magnitude of one polarity and toreverse states when said difference reaches said magnitude in anopposite polarity, whereby the duty cycle of the resulting oscillationsis proportional to the value of said analog voltage.
 5. A converter forconverting an analog voltage to a duty cycle comprising:a capacitor; aresistor connected at one terminal to said capacitor to form a seriescircuit; a differential amplifier; a reference voltage source providedby a zener diode supplied by current from the output of saiddifferential amplifier; switching means including a series connecteddiode and resistor in circuit connecting said zener diode to the outputof said differential amplifier so that the output current of saidamplifier is conducted through the diode portion of an optical isolatorso as to produce conduction of the transistor portion for producing anoutput waveform as an input to a microprocessor programmed to calculatethe duty cycle of said waveform and so that outputs of one polaritycause a fixed voltage to be maintained across said zener diode withoutputs of opposite polarity being disconnected from said zener diode bysaid diode; detecting means including said differential amplifier whoseinverting input is connected to said terminal and whose non-invertinginput is connected to receive both said analog voltage through an inputresistor and a positive feedback signal from the output of saidamplifier by way of a series resistance-capacitance network connectingsaid output to said non-inverting input, said detecting means beingresponsive solely to the difference between said analog voltage and thevoltage at said terminal for causing said switching means to go fromsaid one state to said other when said difference reaches a certainmagnitude of one polarity and to reverse states when said differencereaches said magnitude in an opposite polarity, whereby the duty cycleof the resulting oscillations is proportional to the value of saidanalog voltage.
 6. A converter for converting an analog voltage to aduty cycle comprising:a capacitor; a resistor connected at one terminalto said capacitor to form a series circuit; a differential amplifier; areference voltage source provided by a zener diode supplied by currentfrom the output of said differential amplifier; switching meansincluding a series connected diode and resistor in circuit connectingsaid zener diode to the output of said differential amplifier so thatoutputs of one polarity cause a fixed voltage to be maintained acrosssaid zener diode with outputs of opposite polarity being disconnectedfrom said zener diode by said diode, and a transistor for providing aconductive path to discharge said capacitor through said resistor whensaid transistor is biased to the conductive state, said switching meansbeing operative to selectively pass charging current through said seriescircuit from said reference voltage source in one state and fordisconnecting said source to discharge said capacitor through saidresistor in another state; and detecting means including saiddifferential amplifier whose output is conducted through the diodeportion of an optical isolator so as to produce conduction of thetransistor portion for producing an output waveform as an input to amicroprocessor programmed to calculate the duty cycle of said waveformto produce in digital form a signal representing the magnitude of saidanalog voltage, said detecting means being responsive solely to thedifference between said analog voltage and the voltage at said terminalfor causing said switching means to go from said one state to said otherwhen said difference reaches a certain magnitude of one polarity and toreverse states when said difference reaches said magnitude in anopposite polarity, whereby the duty cycle of the resulting oscillationsis proportonal to the value of said analog voltage.
 7. A voltage to dutycycle converter comprising:a differential amplifier for producing on itsoutput a waveform whose duty cycle is proportional to the analog voltageconnected to its non-inverting input; an input resistor for connectingsaid analog voltage to said input; a negative feedback path connectingthe output of said amplifier to the inverting input, said negativefeedback path includinga series circuit having a first diode connectedto pass amplifier output current in turn through a first seriesconnected resistor, a second series connected resistor, and a capacitorto circuit common, a zener diode connected to maintain constant duringconduction of said first diode, the potential with respect to circuitcommon of that terminal of said second resistor connected to said firstresistor, a resistor connected in parallel to said zener diode toprovide a discharge path for said capacitor, means connecting thejunction between the second series resistor and said capacitor to theinverting input of said amplifier; and a positive feedback circuitconnecting the non-inverting input to that junction of said first diodeopposite the junction connected to the amplifier output, said positivefeedback circuit having a series connected resistor and capacitor.
 8. Avoltage to duty cycle converter for producing an electrically isolateddigital representation of an analog voltage comprising:a differentialamplifier having an analog voltage supplied to its non-inverting input;a negative feedback path connected from the output of said amplifier tothe inverting input, said negative feedback path includingan opticalisolator connected in series with a zener diode, and a series connectedcapacitor and resistor across said diode with the junction between saidresistor and capacitor being connected to said inverting input so thatcurrent through the isolator and diode establish a voltage across thediode such that the capacitor is charged to cause the potential at theinverting input of said amplifier to rise above that of said analogvoltage by a small amount and then upon reversal of the amplifier outputvoltage conduction of the optical isolator is stopped and the capacitordischarges causing the potential at the inverting input to fall to asmall potential below that of said analog voltage at which point thecycle is complete and the amplifier output again reverses to startanother cycle by charging the capacitor again so that the currentthrough said optical isolator has a duty cycle proportional to saidanalog voltage; a series connected capacitor and resistor forming apositive feedback circuit connecting the output of said amplifier to thenon-inverting input so that the waveform of the output from theamplifier is clean at the cross-over points; and a microprocessorconnected to the output of said optical isolator, said microprocessorbeing programmed to calculate the ratio of the time period during whichthe output of the amplifier is positive to the total time period of eachcycle of the amplifier output as an indication of the magnitude of saidanalog voltage.